package org.allen.mst4j.action;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.allen.mst4j.common.Logger;
import org.sol.util.log.Log;
import org.springframework.stereotype.Controller;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.handler.AbstractHandlerExceptionResolver;

@Controller
public class ExceptionResolver extends AbstractHandlerExceptionResolver{

	private Log log = Logger.SYS;
	
	@Override
	protected ModelAndView doResolveException(
			HttpServletRequest httpservletrequest,
			HttpServletResponse httpservletresponse, Object obj,
			Exception exception) {
		ModelAndView mv = new ModelAndView("exception");
		log.debug(exception.getMessage(),exception);

		mv.addObject("exception", exception);
		
		return mv;
	}

}
